#include"progress.h"

#define SIZE 102
#define STYLE '='
#define ARR '>'

void progress()
{
  char bar[SIZE];
  memset(bar,'\0',sizeof(bar));//将bar都设置成\0
  const char *lable = "|/-\\";
  int i=0;
  for(i=0;i<=100;)
  {
    printf("[%-100s][%d%%][%c]\r",bar,i,lable[i%4]);
    fflush(stdout);
    bar[i++]=STYLE;
    if(i!=100)
      bar[i]=ARR;
    usleep(100000);
  }
  printf("\n");
}
